<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page contentType="text/html; charset=UTF-8" deferredSyntaxAllowedAsLiteral="true" %>
<%@ page import="com.health.system.springSecurity.LogonUser;"%>
<!-- 
< % @ page contentType=\"text/html; charset=UTF-8\" deferredSyntaxAllowedAsLiteral=\"true\" % >
 -->
<%@ taglib prefix='sc' uri='http://www.springframework.org/security/tags' %>
<html>
<% //String userName = (null==(String)session.getAttribute("SPRING_SECURITY_LAST_USERNAME")) ? "" : (String)session.getAttribute("SPRING_SECURITY_LAST_USERNAME");
	String userName= LogonUser.getUserRealName();
	//String realPath = application.getRealPath("/");
	String mmsPath = "";		
	
%>
<head>
<%@include file="jqinc.jsp"%>
<title></title>

<style type="text/css">
<!--
body{
	padding:0;
	margin:0;
}
.top{
	width: 100%;
	margin: 0px;
	padding: 0px;
}
.topleft{
	height: 75px;
	width: 200px;
	background-image: url(images/top_left.jpg);
	background-repeat: no-repeat;
	background-position: left top;
	float: left;
}
.top_bg{
	height: 75px;
	background-image: url(images/top_mid.jpg);
	background-repeat: repeat-x;
}
.topright{
	height: 75px;
	width: 250px;
	background-image: url(images/top_right.jpg);
	background-repeat: no-repeat;
	background-position: right top;
	float: right;
}
.topmid{
	float: left;
	height: 75px;
	padding: 0px;
	margin: 0px;
} 
a{
	color: #FFFFFF;
	text-decoration: none;
}
a:hover{
	color: #33FFFF;
	text-decoration: underline;
}
.topname{
	font-size: 24px;
	color: #FFFFFF;
	float: left;
	height: 75px;
	margin-top: 25px;
	margin-bottom: 20px;
	padding: 0px;
	margin-right: 0px;
	margin-left: 2px;
	font-weight: normal;
	font-family: "黑体";
	line-height:24px;
} 
.toptime{
	font-size: 12px;
	color: #FFFFFF;
	float: left;
	height: 75px;
	margin-top: 20px;
	margin-bottom: 20px;
	padding: 0px;
	margin-right: 0px;
	margin-left: 20px;
	line-height: 20px;
} 
.clr { clear:both; padding:0; margin:0; background:none;}
-->
</style>
<link type="text/css" rel="Stylesheet"  href="css/index_rightcss.css" />
<script type="text/javascript">
    
    var zTree,zNodes=[],tab_counter =1,$tabs;
    var mDiv=new Object();//主区域
    var rowData=new Object();//行数据
    mDiv.width =0;
    mDiv.height =0;
    mDiv.userName ="<sc:authentication property='name'/>";
   
    mDiv.loalhostipport='<%=mmsPath%>';//内网服务
    mDiv.remotehostipport='<%=mmsPath%>';//外网服务
	mDiv.bwsType="msie";//浏览器类型默认为IE

	var setting = {
		showLine: true,
		async: true,
		expandSpeed : "",
		callback:{
			click: zTreeOnClick
		}
	};
	
	function zTreeOnClick(event, treeId, treeNode) {
	    openTab(treeNode.id,treeNode.name,treeNode.trl);
	}
	
    function refreshTree(asyncUrl) {
		setting.asyncUrl = asyncUrl;
		zTree = $("#tree").zTree(setting, zNodes);
	}
	
	function loadMenu(id) {
		refreshTree('menu/admin.json?menuid='+id);
	}
	
	function fun_exit() {
		confirm("您确定要退出本系统?", exit);
    }
    
    function exit() {
		location = '<%=request.getContextPath()%>/j_spring_security_logout';
		
    }
    
     function treeDivHeight() {
		$("#treeDiv").height($("#centerDiv").height()-36);
    }
    
    $(window).resize(function() {
	    setTimeout(function() {
	        treeDivHeight();
        }, 500)
    })

$(function() {
    var username = '<%=userName%>';         
    if(username==null||username ==''){
       exit();
       return;
    } 
      
    blockUIOpen('正在加载数据,请稍候...',300,100,true,3000);
    //startclock ();
    $tabs = $( "#centerDiv").tabs({
        //collapsible: true,
		tabTemplate: "<li><a href='#{href}'>#{label}</a> <span class='ui-icon ui-icon-close'>Remove Tab</span></li>",
		
		select: function(event, ui) {
		    //重新加载页面
		   var url = $('#'+ui.panel.id).attr("url");
		   if(url){		   
		       $(ui.panel).load(url);
		   }		   
           return true;
		   
		},
		
		
		add: function(event, ui) {
             $tabs.tabs('select', '#' + ui.panel.id);
        }
	});
	

	

	var myLayout = $('body').layout({
		west__size:	240,
		north__size: 78,
		west__minSize: 200,
		west__maxSize: 300,
		north__resizable: false,
		north__closable:	false,
		center__onresize:	function () {
		    mDiv.width =$("#centerDiv").width();
		    mDiv.height =$("#centerDiv").height();
		    $("#westDiv").trigger("pageResize");
		}
		//applyDefaultStyles: true
	});
		

	myLayout.resizeAll();
	//refreshTree('menu/admin.json');
	refreshTree('system/Menu/list.do');
	tabMenu();
	
	setTimeout(function() {
	    treeDivHeight();
    }, 500)
    
    if($.browser.msie){ 
	    if($.browser.version == "6.0"){
	        mDiv.bwsType ="IE6";
	    }else{
	        mDiv.bwsType ="msie";
	    }
	}else if($.browser.safari){ 
	    mDiv.bwsType ="safari";
	}else if($.browser.mozilla){ 
	   mDiv.bwsType ="mozilla";
	}else if($.browser.opera){ 
	   mDiv.bwsType ="opera";
	}else{ 
	   mDiv.bwsType ="other";
	} 
	
});
    
 //当前时间
 
function tick() {
  
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today, theday;
today = new Date();

function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
var todayStings=today.toDateString();
theday = todayStings.substring(todayStings.length-4)+"-" + [today.getMonth()+1]+"-" +today.getDate() +"  "+ d[today.getDay()+1]+" ";
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
xfile = "午夜";
} else if (intHours < 12) {
hours = intHours+":";
xfile = "上午";
} else if (intHours == 12) {
hours = "12:";
xfile = "正午";
} else  {
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = theday+xfile+hours+minutes+seconds;
 
document.getElementById("Clock").innerHTML = timeString;

window.setTimeout("tick();", 100);
}
window.onload = tick;

$.ajax({  //获得登录系统标题        
            type: "POST",
            url:"sys/SysName/getSysTitle.do",
            dataType: "json",
            success:function(json){
            $("#topname").append(json.msg);
            document.title = json.msg + "管理平台"
             
            }
       })

</script>
</head>
<body>

<div id="top" class="ui-layout-north ui-widget-content"  >
 <div class="top_bg">
  <div class="topleft"></div>
  <div class="topmid">
   <div class="topname" id="topname"></div>
   <div class="toptime">
             欢迎您：<%=userName%> ｜ <a href='javascript:void(0)' onclick='fun_exit()'>退出</a><br /><div id="Clock"> </div>
   </div>
 </div>
  <div class="topright"></div>
 </div>
</div>

<div id ="westDiv" class="ui-layout-west" style="display: none;">
<h3 class="ui-widget-header">系统菜单</h3>
<div id="treeDiv" style="overflow:auto;">
<ul id="tree" class="tree" style="overflow:auto;"></ul>
</div>
</div>
<div id ="centerDiv" class="ui-layout-center" style="display: none;"> 
		<ul style="-moz-border-radius-bottomleft: 0; -moz-border-radius-bottomright: 0;">
			<li><a href="#tab_main"><span>欢迎使用</span></a></li>
		</ul>
		<!-- 主页面区域 -->
         <div id="tab_main">
         
			<div id="content">
		<div class="grid-c2-s4">
			<div class="col-main">
					<div class="main-content">
						<div class="col-a">
							 <div class="left-part"></div>
							 <div class="right-part">
								 <div class="icons"><ul>
									 <li><img src="images/agencies.gif" alt="新增机构" width="80" height="70" border="0" /></li>
									 <li><img src="images/log.gif" alt="重新登录" width="70" height="70" border="0" /></li>
									 <li><img src="images/groups.gif" alt="群组管理" width="70" height="70" border="0" /></li>
									 <li><img src="images/customer.gif" alt="客户资料" width="70" height="70" border="0" /></li>
									 <li class="last"><img src="images/submitted.gif" alt="信息报送" width="80" height="70" border="0" /></li>
								 </ul></div>
						</div>
						<div class="clr"></div>
						</div>
						<div class="col-b">
							 <div class="left-part"></div>
							 <div class="right-part">
								 <div class="icons"><ul>
									 <li><img src="images/submitted.gif" alt="信息报送" width="80" height="70" border="0" /></li>
									 <li><img src="images/refer.gif" alt="提交" width="70" height="70" border="0" /></li>
									 <li><img src="images/check.gif" alt="审核" width="70" height="70" border="0" /></li>
									 <li><img src="images/send.gif" alt="发送" width="70" height="70" border="0" /></li>
									 <li class="last"><img src="images/statistics.gif" alt="统计监控" width="80" height="70" border="0" /></li>
								 </ul>
								 </div>
						</div>
						</div>
                    </div>
				</div>
		</div>
	</div>
		</div>
</div>

<div  class=contextMenu id=tabMenu>
  <ul>
    <li id=closeother><img src="images/info.gif"/>&nbsp关闭其它</li>
    <li id=closeall><img src="images/delete.gif"/>&nbsp关闭所有</li>
  </ul>
</div>
<div id="dialogconfirm"></div>


</body>
</html> 